// pages/evaluation/evaluation.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    reviews: [
      { reviewer: 'A  ', rating: 4, comment: '很好的一次体验' },
      { reviewer: 'B  ', rating: 5, comment: '很开心' },
      // Add more reviews
    ],
    userReview: '', // User's review input
  },
  onReviewInput(e) {
    this.setData({ userReview: e.detail.value });
  },
  submitReview() {
    // Implement logic to submit the user's review and save it to the database/API
    const newUserReview = {
      reviewer: 'You', // Assuming the user's own review
      rating: 5, // Example rating
      comment: this.data.userReview,
    };

    // Update the reviews array with the new user review
    const reviews = this.data.reviews;
    reviews.push(newUserReview);
    this.setData({ reviews, userReview: '' });

    // You can now save the review to your database or API

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})